package com.group.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.group.pojo.TbCustomer;
import com.group.service.CustomerService;

@Controller
@RequestMapping("/customer")
public class CustomerController {
     @Autowired
     private CustomerService customerService;
     
     
     //查询客户信息
     @RequestMapping("/query.action")
     @ResponseBody
     public List<TbCustomer> query(TbCustomer customer){
    	 return customerService.query(customer);
     }
     
     //登录
     @RequestMapping("/login.action")
     @ResponseBody
     public Map<String, String> login(TbCustomer customer, HttpServletRequest request) {
    	 Map<String, String> map = customerService.login(customer, request);
    	 return map;
     }
     
     //登录
     @RequestMapping("/logout.action")
     @ResponseBody
     public Map<String, String> logout(HttpServletRequest request) {
    	 Map<String, String> map = customerService.logout(request);
    	 return map;
     }
     
     //登录
     @RequestMapping("/isLogin.action")
     @ResponseBody
     public Map<String, String> isLogin(HttpServletRequest request) {
    	 Map<String, String> map = customerService.isLogin(request);
    	 return map;
     }
}























